INSERT INTO cat_shieldedcompany
SELECT 
case len(convert(varchar(10),f.id))
	when 7 then '00000000-0000-0000-0000-00000' + convert(varchar(10),f.id) 
	when 6 then '00000000-0000-0000-0000-000000' + convert(varchar(10),f.id) 
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),f.id) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),f.id) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),f.id) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),f.id) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),f.id) 
    end As Id,'00000000-0000-0000-0000-00000' + convert(varchar(7),userid) AS [JobseekId],case len(convert(varchar(10),companyid))
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),companyid) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),companyid) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),companyid) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),companyid) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),companyid) 
    end AS [CompanyId],c.companyname AS [CompanyName]FROM srv_lnk.nchr2008.dbo.companyfliter f inner join srv_lnk.nchr2008.dbo.companyinfo c
on f.companyid = c.id
--select count(*) from srv_lnk.nchr2008.dbo.companyfliter

